var hostroot=PARAMS.HTTPHOST+"__"+PARAMS.BASEURL.replace(/\//g,"_");
var key=hostroot+"__widget_title_vals";
var store=new Persist.Store("blog-enhanced");
var titles=new Array();
var title_vals=new Array();
store.get(key,function(a,b){
    if(a&&b!=null)
    {
        title_vals=b.toString().replace("\n","","g").split(",")
    }
});
var i=0;
$(".portlet .portlet-decoration").each(function(){
    titles[i]=$(this).html().replace("\n","","g");
    if(title_vals[i]!=0)
    {
        title_vals[i]=1
    }
    if(title_vals[i++]==0)
    {
        $(this).next().hide()
    }
});
$(".portlet .portlet-decoration").click(function(){
    var d=$(this).html().replace("\n","","g");
    for(var b in titles)
    {
        var c=titles[b];
        var a=title_vals[b];
        if(c==d)
        {
            if(a==0)
            {
                $(this).next().slideDown();
                title_vals[b]=1
            }
            else
            {
                $(this).next().slideUp();
                title_vals[b]=0
            }
        }
        else
        {
            if(a!=0)
            {
                title_vals[b]=1
            }
        }
    }
    store.set(key,title_vals.join())
});
